package oo.day05.union;
import java.util.Scanner;
public class UnionPayTest {

	public static void main(String[] args) {
		Union card = new ICBCImpl(2000,"123456");
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入密码:");
		String pwd = scan.next();
		if(card.checkPwd(pwd)) {
			System.out.println("请输入金额:");
			double num = scan.nextDouble();
			if(card.getMoney(num)) {
				System.out.println("取钱成功,卡余额为:"+card.queryMoney());
			}else {
				System.out.println("余额不足");
			}
		}else {
			System.out.println("密码错误");
		}
		scan.close();
	}

}
